import { createApp } from 'vue';
import { setupRouter } from '@/router';
import { setupStore } from '@/store/index';
import { setupGlobDirectives } from '@/directives';

import App from './App.vue';
import ElementPlus,{ ElMessage } from 'element-plus';
import Antd from 'ant-design-vue';
import hljsVuePlugin from '@highlightjs/vue-plugin'


// highlight 的样式，依赖包，组件
import 'highlight.js/styles/atom-one-dark.css'
import 'highlight.js/lib/common'

// svg内引入注册脚本
import 'virtual:svg-icons-register';

import '@/styles/index.scss'
import 'ant-design-vue/dist/antd.css';
import 'element-plus/lib/theme-chalk/index.css'

import svgIcon from "@/components/svgIcon/index.vue";

async function bootstrap() {
  const app = createApp(App);

  app.config.globalProperties.$message = ElMessage;

  // 使用pinia
  setupStore(app)

  // 使用router
  setupRouter(app)

  setupGlobDirectives(app)

  app.use(Antd).use(ElementPlus).use(hljsVuePlugin)

  app.component('svg-icon', svgIcon)

  app.mount('#app');
}

bootstrap()
